package cn.joker.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * created By huangxumin on
 * @author huangxumin
 */
public class TransactionConstant {

    public static final Map<Integer, String> ADD_CELL_INDEX_AND_FIELD_NAME = new HashMap<>();
    public static final Map<Integer, String> EDIT_CELL_INDEX_AND_FIELD_NAME = new HashMap<>();


    static {
        ADD_CELL_INDEX_AND_FIELD_NAME.put(1, "id");
        ADD_CELL_INDEX_AND_FIELD_NAME.put(2, "unitName");
        ADD_CELL_INDEX_AND_FIELD_NAME.put(3, "deviceType");
        ADD_CELL_INDEX_AND_FIELD_NAME.put(4, "voltage");
        ADD_CELL_INDEX_AND_FIELD_NAME.put(5, "bdzName");
        ADD_CELL_INDEX_AND_FIELD_NAME.put(6, "addDeviceName");
        ADD_CELL_INDEX_AND_FIELD_NAME.put(7, "state");
        ADD_CELL_INDEX_AND_FIELD_NAME.put(8, "applicantName");
        ADD_CELL_INDEX_AND_FIELD_NAME.put(9, "applicantPhone");

        EDIT_CELL_INDEX_AND_FIELD_NAME.put(1, "id");
        EDIT_CELL_INDEX_AND_FIELD_NAME.put(2, "unitName");
        EDIT_CELL_INDEX_AND_FIELD_NAME.put(3, "jurisdiction");
        EDIT_CELL_INDEX_AND_FIELD_NAME.put(4, "propertyRights");
        EDIT_CELL_INDEX_AND_FIELD_NAME.put(5, "deviceType");
        EDIT_CELL_INDEX_AND_FIELD_NAME.put(6, "voltage");
        EDIT_CELL_INDEX_AND_FIELD_NAME.put(7, "cause");
        EDIT_CELL_INDEX_AND_FIELD_NAME.put(8, "basis");
        EDIT_CELL_INDEX_AND_FIELD_NAME.put(9, "beforeDeviceName");
        EDIT_CELL_INDEX_AND_FIELD_NAME.put(10, "laterDeviceName");
        EDIT_CELL_INDEX_AND_FIELD_NAME.put(11, "state");
    }


    public static String getAddFieldName(int cellIndex){
        return ADD_CELL_INDEX_AND_FIELD_NAME.getOrDefault(cellIndex, "");
    }

    public static String getEditFieldName(int cellIndex){
        return EDIT_CELL_INDEX_AND_FIELD_NAME.getOrDefault(cellIndex, "");
    }
}
